import Vue from 'vue'
import VueRouter from 'vue-router'

// import Home from '../components/Home'
// import Fav from '../components/Fav'
// import Config from '../components/Config'

import A from '../components/A'
import B from '../components/B'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   component: Home
  // },
  // {
  //   path: '/fav',
  //   component: Fav
  // },
  // {
  //   path: '/config',
  //   component: Config
  // },
  {
    path: '/',    //路径
    name:'a',     //名称:基本上做标识或者判断
    component: A  //访问对应组件
  },
  {
    path: '/b',
    component:B,
  },
  {
    path:'*',
    redirect:A
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
